1. Field of the Invention
The present invention relates to a replica system and a method of producing a replica, by which a replica is produced among different databases and/or files.
2. Description of the Prior Art
Today, many computers are used in decentralized fashion and especially small-size computers are distributed to each department of a workplace. In such an environment, before starting business of the day, data necessary for databases or files of each distributed computer is customarily copied from a master database or master file on a host computer. After closing work of the day, revised data is copied into the host computer so as to update the master database or the master file.
As mobile computing technology has been developed, a user can use a computer outside his or her office, say at a customer""s site or an employee""s home. For example, when sales people start their operations of the day, they may copy necessary information from a master database or master file on a host computer to databases or files of their mobile computers. At the end of the day, these people transmit sales data and cost data to the host computer for updating the master database or master file on the host computer. This is the most effective method in terms of reduction of communication cost and access time.
Generally, a data exchange method and a system adopting this method are respectively referred to as a method of producing replica(s) and a replica system, in which data is copied between a plurality of databases and files.
FIG. 20 illustrates configuration of an existing replica system. In the figure, a replica system comprises a host computer 1001 and a distributed computer 1002 such as a mobile computer. The host computer 1001 and the distributed computer 1002 are connected together via a communication medium, say a LAN (local area network) or Internet.
The host computer 1001 has a master database A 1003 (master database is hereinafter referred to as xe2x80x9cmaster DBxe2x80x9d) and a master DB B 1004, and also has a database management system A 1005 (database management system is hereinafter abbreviated to xe2x80x9cDBMSxe2x80x9d) and a DBMS B 1006 for managing each of the master DBs. It should be noted that these DBMS A 1005 and DBMS B 1006 may use either the same type of database programs or a different type of database programs.
The distributed computer 1002 consists of a copy database C 1007 (copy database is hereinafter referred to as xe2x80x9ccopy DBxe2x80x9d) and a copy DB D 1008 used for copying necessary data from the master DB A 1003, and consists of a DBMS C 1009 and a DBMS D 1010 which are database management systems for managing each of the copy DBs. DBMS C 1009 and DBMS D 1010 use the same type of database programs which are the same as those used by the DBMS A 1005 of the host computer.
A database replica program 1011 presets the correspondence between the master DBs of the host computer 1001 and the copy DBs of the distributed computer 1002, and controls data copying between databases at user""s request. This database replica program 1011 is located in the host computer 1001.
The operation of the database replica program 1011 will be described below.
When the user requests a data copy from the master DB A 1003 to the copy DB C 1007, data is read from the master DB A 1003 via the DBMS A 1005 and written into the copy DB C 1007 via the DBMS C 1009. When the user requests a copy of the updated data from the copy DB C 1007 to the master DB A 1003, the updated data is read from the copy DB C 1007 via the DBMS C 1009. The data is then written into the master DB A 1003 via DBMS A 1005.
Similarly, copying of data is performed between the master DB A 1003 and the copy DB D 1008. However, the updated data in the copy DB D 1008 cannot be copied to the master DB B 1004 as shown in FIG. 20 by a broken line if the DBMSs managing the copy DB D and the master DB B use different types of database programs. Even when the database programs are of the same type, copying is not available unless the correspondence between a copy DB and a master DB exists in the database replica program 1011.
The host computer 1001 has a master file 1012 and a file replica program 1013, while the distributed computer 1002 contains a copy file 1014 which corresponds to the master file 1012.
Correspondence between the master file 1012 on the host computer 1001 and the copy file 1014 of the distributed computer 1002 is preset in the file replica program 1013. The program then controls copying of data between the files at user""s request.
Many types of database programs are now available in the market and they are specifically used according to their intended use. For example, a database management system using a database program such as DB2(trademark) by IBM Corporation or Oracle 8(trademark) by Oracle Corporation which are capable of processing many tasks at one time, in parallel, is suitable for a host computer which may be used by many people simultaneously. On the other hand, for computers for private-use, such as a mobile computer, where tasks are sequentially created, a database management system using a database program with less load, say Oracle light(trademark) by Oracle Corporation or Access(trademark) by Microsoft Corporation, is suitable.
However, in the conventional replica system, the database replica program is designed in correspondence with a specific database program. Therefore, the system cannot interface with a database management system Using different types of database programs. Accordingly, a master DB and a copy DB should be managed by a database management system which uses the same types of database programs. Management of this kind prevents a system construction from becoming a flexible one which operates conforming to a load.
When constructing a replica system which produces a replica between databases or between files, two types of program, namely, a database replica program and a file replica program are required. This requirement adds to the load on the system.
Furthermore, the database replica program must have all data necessary for copying, including data in tables of the copy DB and the master DB, thus making the system construction complicated. Particularly, the whole of the database replica program has to be modified each time a data format of the copy DB or copy file is added or converted, which makes the modification procedure very complicated.
In addition, when the user intends to add some additional function, such as a character code conversion, he or she has a difficult task, such as to modify the whole of the database replica program. Addition of such a function is therefore not feasible in actuality.
The present invention aims to solve the problems mentioned above. It is a primary object of this invention to provide a replica system with a less load, which can deal with a database management system including plural kinds of database programs and can deal with files.
It is another object of the present invention to provide a replica system to which a user can easily add or modify a data format of the copy DB or the copy file, as well as add a function, such as a character code conversion.
According to one aspect of the invention, the objects of the invention are achieved by a replica system having first data storage means, first data management means for managing the first data storage means, second data storage means, and second data management means for managing the second data storage means, wherein replica of data is produced between said first data storage means and said second data storage means; comprising, replica management means for receiving a replica instruction, and, according to the replica instruction, determining an object to be read from said first data storage means and an object to be written in said second data storage means, first interface means, giving a command to said first data management means, for reading from said first data storage means data associated with said object to be read, and converting a format of the data into a standard data format specified in said system, and second interface means for receiving data in the standard data format from said first interface means, converting the format of the data into a data format associated with the object to be written, and writing the data in the converted format into said second data storage means by giving a command to said second data management means.
It is preferable that in the replica system, at least one of said first data storage means and said second data storage means is a database.
It is preferable that in the replica system, at least one of said first data storage means and said second data storage means is a data file.
It is also preferable that in the replica system, the replica management means has replica pattern storage means for storing replica pattern data with information concerning the object to be read and the object to be written.
It is preferable that in the replica system, the replica pattern data includes code conversion information.
According to another aspect of the invention, the objects of the invention are achieved by the replica system, further comprising replica instruction storage means in which the replica instruction is stored, wherein said replica management means reads the replica instruction from said replica instruction storage means.
According to still another aspect of the invention, the objects of the invention are achieved by the replica system, wherein each of said first interface means and second interface means has an interchangeable interface driver.
According to still another aspect of the invention, the objects of the invention are achieved by the replica system, wherein said replica management means has first replica distribution management means for sending data to and receiving data from said first interface means, and has second replica distribution management means for sending data to and receiving data from said second interface means.
According to still another aspect of the invention, the objects of the invention are achieved by the replica system, wherein said first interface means and first replica distribution management means are located on a first computer, and said second interface means and second replica distribution management means are located on a second computer, said first computer and second computer being connectable via a communication medium.
According to still another aspect of the invention, the objects of the invention are achieved by the replica system, wherein said first computer has first communication interface means for managing communication, and said second computer has second communication interface means for managing communication, whereby said first communication interface means may be connected to said second communication interface means in accordance with an instruction sent from said first replica distribution management means, and said second communication interface means may be connected to said first communication interface means in accordance with an instruction sent from said second replica distribution management means.
According to another aspect of the invention, the objects of the invention are achieved by the replica system, wherein said first computer has first communication information storage means for storing communication information used for communication with said second computer, and said second computer has second communication information storage means for storing communication information used for communication with said first computer.
It is preferable that in the present replica system, the communication information is a communication address.
According to a further aspect of the invention, the objects of the invention are achieved by a method of producing replica in a system having first data storage means managed by first data management means and second data storage means managed by second data management means, the method comprising the steps of receiving a replica instruction; determining, according to the replica instruction, an object to be read from said first data storage means and an object to be written in said second data storage means; reading from said first data storage means data associated with the object to be read, by giving a command to said first data management means; converting the data into a standard data format specified in said system; converting the data in the standard data format into data in a format associated with the object to be written; and writing the data in the format associated with the object to be written into said second data storage means, by giving a command to said second data management means.
According to a still further aspect of the invention, the objects of the invention are achieved by a method of producing replica in a system having first data storage means managed by first data management means and second data storage means managed by second data management means, wherein said first data storage means is on a first computer where said first data management means is located, and said second data storage means is on a second computer where said second data management means is located, the method comprising the steps of receiving a replica instruction; determining, according to the replica instruction, an object to be read from said first data storage means and an object to be written in said second data storage means; reading from said first data storage means data associated with the object to be read, by giving a command to said first data management means; converting the data into a standard data format specified in said system; connecting said first computer and second computer via a communication medium; causing said first computer to send the data in the standard data format; causing said second computer to receive the data in the standard data format; converting the data received into a format associated with the object to be written; and writing the data in the format associated with the object to be written into said second data storage means, by giving a command to said second data management means.